home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / dviware / qms / vms / doilatex.com < prev    next >
Text File  |  1990-10-01  |  3KB  |  107 lines

  1. $ if P1 .eqs. "" then inquire P1 "$_File"
  2. $ if P1 .eqs. "" then exit
  3. $ doprint = 1
  4. $ dodelete = 1
  5. $ copystring = ""
  6. $ PT2 = P2
  7. $ PT3 = P3
  8. $ PT4 = P4
  9. $ PT5 = P5
  10. $nextparam:
  11. $ if PT2 .eqs. "" then goto doneparse
  12. $ goto 'f$extract(0,3,PT2)'
  13. $nop:
  14. $NOP:
  15. $ doprint = 0
  16. $ goto checknext
  17. $nod:
  18. $NOD:
  19. $ dodelete = 0
  20. $ goto checknext
  21. $cop:
  22. $COP:
  23. $ copystring = "/"+PT2
  24. $checknext:
  25. $ PT2 = PT3
  26. $ PT3 = PT4
  27. $ PT4 = PT5
  28. $ goto nextparam
  29. $doneparse:
  30. $ device   = f$parse(P1,,,"DEVICE")
  31. $ directory= f$parse(P1,,,"DIRECTORY")
  32. $ filename = f$parse(P1,,,"NAME")
  33. $ filetype = f$parse(P1,".TEX",,"TYPE")
  34. $ version  = f$parse(P1,,,"VERSION")
  35. $ directory = f$extract(1,f$length(directory)-2,directory)
  36. $ filespec = "''device'[''directory']''filename'''filetype'''version'"
  37. $ message = ""
  38. $ NumCopies = "1"
  39. $ response = "Y"
  40. $ if filetype .nes. ".TEX" then -
  41.     inquire response "Is this a TeX file? (Y/N) [N]"
  42. $ if response .nes. "Y" then goto dotex_abort
  43. $ on control_Y then goto abort_ctrlY
  44. $ on error then goto error_exit
  45. $!    ------------------------
  46. $!    --- Process LATeX File --- (italian hyphenation)
  47. $!    ------------------------
  48. $ if f$search("''filespec'") .eqs. "" then goto TeXfilnotfou
  49. $ write sys$output "  executing TeX.."
  50. $ write sys$output ""
  51. $ assign/user_mode sys$command sys$input
  52. $ ILATEX 'filespec'
  53. $!    ------------------------
  54. $!    --- Process DVI File ---
  55. $!    ------------------------
  56. $ if f$search("''filename'.DVI") .eqs. "" then goto DVIfilnotfou
  57. $ write sys$output "  executing DVIQMS.."
  58. $ assign/user_mode sys$command sys$input
  59. $ DVIQMS 'filename''copystring'
  60. $!    ---------------------
  61. $!    --- Print BITfile ---
  62. $!    ---------------------
  63. $ if doprint .eq. 0 then goto normexit
  64. $ if f$search("''filename'.BIT") .eqs. "" then goto BITfilnotfou
  65. $ delstring = ""
  66. $ if dodelete .ne. 0 then dodelete = "/delete"
  67. $ write sys$output "  printing ''filename'.."
  68. $ lasprint/notify'delstring' 'filename'.BIT
  69. $normexit:
  70. $ if dodelete .eq. 0 then exit
  71. $ write sys$output -
  72.     "  deleting temporary files.."
  73. $!    --------------------------
  74. $!    --- Delete Temp Files ----
  75. $!    --------------------------
  76. $ if f$search("''filename'.DVI") .nes. "" then -
  77.     delete/noconfirm/nolog  'filename'.DVI;
  78. $ if f$search("''filename'.LIS") .nes. "" then -
  79.     delete/noconfirm/nolog  'filename'.LIS;
  80. $ exit
  81. $!
  82. $abort_ctrlY:
  83. $ message = "Control-Y termination."
  84. $ goto dotex_abort
  85. $error_exit:
  86. $ message = "Error detected."
  87. $ goto dotex_abort
  88. $TeXfilnotfou:
  89. $ message = "Input file ''filespec' not found."
  90. $ goto dotex_abort
  91. $DVIfilnotfou:
  92. $ message = "DVI file not created."
  93. $ goto dotex_abort
  94. $BITfilnotfou:
  95. $ message = "BIT file not created."
  96. $ goto dotex_abort
  97. $dotex_abort:
  98. $ if f$search("''filename'.DVI") .nes. "" then -
  99.     delete/noconfirm/log  'filename'.DVI;
  100. $ if f$search("''filename'.LIS") .nes. "" then -
  101.     delete/noconfirm/log  'filename'.LIS;
  102. $ if f$search("''filename'.BIT") .nes. "" then -
  103.     delete/noconfirm/log  'filename'.BIT;
  104. $ write sys$output "DoTeX aborted."
  105. $ if message .nes. "" then write sys$output message
  106. $ exit
  107.